//
//  CedarButton.h
//  CedarFinancePH
//
//  Created by lshenrong on 2018/3/20.
//  Copyright © 2018年 cedarhd. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef void(^ClickEvent)(void);


typedef NS_ENUM(NSInteger, ButtonLayoutType){
    LayoutTypeLeftImageRightText,
    LayoutTypeLeftTextRightImage
};



@interface CedarButton : UIButton

@property (nonatomic,copy) ClickEvent clickEvent;

+ (instancetype)buttonWithText:(NSString *)text;


+ (instancetype)buttonWithBorderRegisterText:(NSString *)text;


+ (instancetype)buttonWithText:(NSString *)text cornerRadius:(CGFloat)radius;

+ (instancetype)buttonWithImageName:(NSString *)imageName;

+ (instancetype)buttonWithImage:(UIImage *)image;

+ (instancetype)buttonWithRightText:(NSString *)text leftImage:(NSString *)imageName;



#pragma mark - 新的按钮方法

/**
 只有文本，无样式,默认kMasterColor
 */
+ (instancetype)buttonWithTextNoStytle:(NSString *)text;
/**
 只有文本，无样式,自定义颜色
 */
+ (instancetype)buttonWithTextNoStytle:(NSString *)text color:(UIColor *)color;

/**
 文本，带背景通用样式
 */
+ (instancetype)buttonWithRegisterText:(NSString *)text;


/**
 边框,文本颜色
 */
+ (instancetype)buttonWithText:(NSString *)text borderColor:(UIColor *)color;
+ (instancetype)buttonWithText:(NSString *)text borderColor:(UIColor *)color textColor:(UIColor *)textColor;

/**
 文本，带橙色样式
 */
+ (instancetype)buttonWithOrderText:(NSString *)text;
+ (instancetype)buttonWithBuyTextNoGradientLayer:(NSString *)text;

//专为为产品标签设计
+ (instancetype)buttonWithProductTagText:(NSString *)text;


/**
 文本 ，背景颜色
 */
+ (instancetype)buttonWithLeftText:(NSString *)text
                        rightImage:(NSString *)imageName
                   backgroundImage:(NSString *)bgImage;

+ (instancetype)buttonWithLeftText:(NSString *)text
                        rightImage:(NSString *)imageName
                   backgroundImage:(NSString *)bgImage
                         topOffset:(CGFloat)offsetX;

+ (instancetype)buttonWithText:(NSString *)text
                   backgroundImage:(NSString *)bgImage;

/**
 带有渐变色的按钮
 */


+ (instancetype)buttonWithTextForGradient:(NSString *)text;
- (void)setGradientStartColor:(UIColor *)startColor endColor:(UIColor *)endColor;
+ (instancetype)buttonWithTextForGradientForCommomn:(NSString *)text radius:(BOOL)hasRadius;


/**
 带有选中颜色按钮
 */


+ (instancetype)buttonWithText:(NSString *)text borderColor:(UIColor *)color selectedColor:(UIColor *)selectedColor;

@end
